import java.util.Arrays;

/**
 * @author SaoE
 * @date 2025/3/3 17:50
 */
public class _300 {
    public int lengthOfLIS(int[] nums) {
        int len = nums.length;
        int[] dp = new int[len + 1];
        int res = 1;
        Arrays.fill(dp, 1);
        for (int i = 0; i < len; i++){
            for (int j = 0; j < i; j++){
                if (nums[j] < nums[i]){
                    dp[i] = Math.max(dp[i], dp[j] + 1);
                    res = Math.max(dp[i], res);
                }
            }
        }
        return res;
    }
}
